<template>
  <div class="alet_container">
    <section class="tip_text_container">
      <div class="tip_icon">
        <span></span>
        <span></span>
      </div>
      <p class="tip_text">{{alertText}}</p>
      <div class="confrim_cancel"  style="margin-top: 10px">
        <div class="cancel" @click="closeTip">{{LeftText}}</div>
        <div class="confrim" @click="goToDo">{{RightText}}</div>
      </div>

    </section>
  </div>
</template>

<script>
export default {
  name: 'Alert',
  props: ['alertText', 'LeftText', 'RightText'],
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  methods: {
    closeTip () {
      this.$emit('closeTip')
    },
    goToDo () {
      this.$emit('goToDo')
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .alet_container{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background-color: rgba(0,0,0,0.3);
  }
  .tip_text_container{
    position: absolute;
    width: 90%;
    bottom: 30px;
    left: 5%;
    border: 1px;
    animation: tipMove .4s ;
    border-radius: 0.7rem;
    display: flex;
    padding-top: 20px;
    padding-bottom: 20px;
    padding-right: 1rem;
    padding-left: 1rem;
    background-color: rgba(255,255,255,0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }
  .tip_text{
    color: black;
    font-size: 0.4rem;
    font-weight: bold;
    line-height: 0.8rem;
  }
  @media screen and (min-width: 320px) {
    .cancel{
      padding: 0.2rem  2rem;
      float: left;
      border-radius: 0.5rem;
      box-shadow: 0px 0px 0px  0.2px #888888;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
    }
    .confrim{
      padding: 0.2rem  2rem;
      float: left;
      box-shadow: 0px 0px 0px 0.2px #888888;
      border-radius: 0.5rem;
      margin-left: 10px;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
    }
  }
  @media screen and (max-width: 320px) {
    .cancel{
      padding: 0.2rem  2rem;
      float: left;
      border-radius: 0.5rem;
      box-shadow: 0px 0px 0px 0.2px #888888;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
    }
    .confrim{
      padding: 0.2rem  2rem;
      float: left;
      box-shadow: 0px 0px 0px 0.2px #888888;
      border-radius: 0.5rem;
      margin-left: 10px;
      color:rgb(1,101,204);
      font-weight: bold;
      font-size: 0.3rem;
    }
  }

</style>
